<template>
	<view class="content">
		<view class="title">
			<view class="TJtitle">推荐歌单</view>
			<view class="icon" @tap="gotocommend()">
				<text>更多<u-icon name="arrow-right"></u-icon></text>
			</view>
		</view>
		<!-- 推荐歌单内容 -->
		<scroll-view class="box" scroll-x>
			<view class="scroll">
				<view  @tap="send(item.id)" class="scroll-item" v-for="(item,index) in recommendlist" :key="item.id">
					<image class='img' :src="item.picUrl"></image>
					<text class="text">{{item.name}}</text>
					<view class="icon-bg">
						<image class="icon-img" src="../static/icon/play.png" mode=""></image>
						<text>{{item.playCount>10000?(((item.playCount-item.playCount%1000)/10000+'万')):(item.playCount)||
						item.playCount>100000000?(((item.playCount-item.playCount%1000)/100000000+'亿')):(item.playCount)}}</text>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		name: "recommend",
		data() {
			return {
				Musiclist: []
			};
		},
		props: ['recommendlist'],
		methods: {
			send(id) {
				uni.navigateTo({
					url: '/subpag/recommendationList/recommendationList?id=' + id
				})
			},
			gotocommend() {
				uni.navigateTo({
					url: '/subpag/RecommendedSongList/RecommendedSongList'
				})
			}

		},
		created() {
			this.Musiclist = uni.getStorageSync("userData");
		}
	}
</script>

<style>
	.TJtitle {
		font-size: 16px;
	}

	.title {
		padding: 0 30rpx;
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
		box-sizing: border-box;
		height: 100rpx;
		align-items: center;
		display: flex;
		justify-content: space-between;
		font-weight: 600;

	}

	.icon {
		border: 1px solid #e5e5e5;
		border-radius: 10px;
		justify-content: center;
		padding: 2px;
		color: black;
		display: flex;
		width: 60px;
		font-weight: 500;
		font-size: 10px;
	}

	.icon-bg {
		background-color: #666666;
		border-radius: 6px;
		opacity: 0.5;
		position: absolute;
		top: 18px;
		right: 5px;
		color: #FFFFFF;
	}

	.icon-img {
		width: 10px;
		height: 10px;
		margin: 0 3px;
	}


	.scroll {
		width: 100%;
		padding: 0 30rpx;
		display: flex;
	}

	.box {
		margin-bottom: 10px;
	}

	.img {
		width: 200rpx;
		height: 200rpx;
		border: 1px solid #EFEFEF;
		border-radius: 10px;
		box-shadow: 0px -5px 0px 0px rgba(0, 0, 0, .1);
		margin-top: 10px;
		

	}

	.text {
		font-size: 26rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.scroll-item {
		width: 200rpx;
		display: flex;
		flex-direction: column;
		margin-right: 10px;
		position: relative;
		
	}
</style>
